package cn.com.dcsgo.service.impl;

import cn.com.dcsgo.domain.bo.CustomerTotalHistoricalTransactionAmountBO;
import cn.com.dcsgo.domain.dto.OrderPageDTO;
import cn.com.dcsgo.domain.vo.OrderVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.com.dcsgo.domain.po.Order;
import cn.com.dcsgo.service.OrderService;
import cn.com.dcsgo.mapper.OrderMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 针对表【order(订单表)】的数据库操作Service实现
 *
 * @author Dcsgo
 * @since 13/5/2025 上午 10:54
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order>
        implements OrderService {

    @Override
    public List<CustomerTotalHistoricalTransactionAmountBO> getCustomerTotalHistoricalTransactionAmountBOList() {
        return baseMapper.selectCustomerTotalHistoricalTransactionAmountBOList();
    }

    @Override
    public IPage<OrderVO> getPage(Page<OrderVO> pageParam, OrderPageDTO orderPageDTO) {
        return baseMapper.selectOrderVOPage(
                pageParam,
                orderPageDTO.getCustName(),
                orderPageDTO.getItemName(),
                orderPageDTO.getState(),
                orderPageDTO.getOrderDateBegin(),
                orderPageDTO.getOrderDateEnd(),
                orderPageDTO.getTotalAmountMin(),
                orderPageDTO.getTotalAmountMax()
        );
    }
}




